/**
 * 
 */
package GUI.main;

import java.awt.Component;
import java.awt.Dimension;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

import OfficeServer.users.Patient;

/**
 * @author mramsey3
 *
 */
public class PatientListRenderer extends JLabel implements ListCellRenderer{

    @Override
    public Component getListCellRendererComponent(JList list, Object value,
	    int arg2, boolean isSelected, boolean arg4) {
	Patient patient = (Patient) value;
	setText(patient.getFirstName()+" "+patient.getLastName());
	if(isSelected){
		setBackground(list.getSelectionBackground());
		setForeground(list.getSelectionForeground());
	}else{
		setBackground(list.getBackground());
		setForeground(list.getForeground());
	}
	setEnabled(list.isEnabled());
	setFont(list.getFont());
	setOpaque(true);
	setPreferredSize(new Dimension(getWidth(), 40));
	
	return this;
    }

}
